@import '../common/index.scss';
@import '../tokens/index.scss';

/// 获取 motion 对应 css 变量名
/// @access private
@function get-motion-css-name-var($key) {
  $var-name: 'motion-' + $key;

  @return with-prefix-var($var-name);
}

/// 获取 motion duration 对应 css 变量值
/// @access private
@function use-motion-duration-var($key) {
  $var-name: get-motion-css-name-var('duration-' + $key);
  $var-value: get-motion-duration($key);

  @return var(#{$var-name}, #{$var-value});
}

/// 获取 motion bezier 对应 css 变量值
/// @access private
@function use-motion-bezier-var($key) {
  $var-name: get-motion-css-name-var('bezier-' + $key);
  $var-value: get-motion-bezier($key);

  @return var(#{$var-name}, #{$var-value});
}

/// 设置 motion duration 值
@function use-motion-duration($key) {
  @return use-motion-duration-var($key);
}

/// 设置 motion bezier 值
@function use-motion-bezier($key) {
  // normal 表示通用默认。这里统一收敛，可根据规范调整
  @if ($key == 'normal') {
    $key: 'easing';
  }

  @return use-motion-bezier-var($key);
}
